<!DOCTYPE html>
<html>
<#include "/views/ftl/base/manager_include.ftl">
<script type="text/javascript" src="${basePath}js/My97DatePicker/WdatePicker.js"></script>
<base href="${basePath}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加品牌</title> 
</head>
<body style="background:#eef3f7;">
<#include "/views/ftl/base/head.ftl"> 
<div class="Main">
  <div class="dw">
<#include "/views/ftl/base/menu.ftl">
<#function a><#return "添加品牌_List"></#function> 
<!--右边内容-->
<div class="Rightbox fl">
    <!--导航-->
    <div class="Bread_crbs clear">
      <div class="Bread_crbs_img fl"></div>
      <div class="Bread_crbs_text fl">
      	<a href="javascript:void(0);"><span>商品管理</span></a>
      	<span class="fnt_famy">></span>
      	<a href="javascript:void(0);"><span>添加品牌</span></a>
      </div>
    </div>
      <div class="Table">
        </div>
  <!--表格列表-->
        <div class="Table"> 
          
          <div class="input_name">
             <span class="left_title">品牌名称：</span>
             <input type="text" name="brandName" class="search_text tdd50" style="width:210px" value=""> 
          </div>
          
          <div class="input_name" style="    height: 98px;">
			<span class="left_title" style="    padding-top: 37px;">品牌LOGO:</span>
			
			<div style="padding-left: 10px;">
			<span >（请上传一张Logo图）</span> 
			 <input name="brandLogo" id="image1" value="" type="hidden">
        			<div id="divStatus" style="display:none;"></div>  
				<span id="spanButtonPlaceHolder"></span>
				<input id="btnCancel" type="button" value="Cancel All Uploads" onclick="swfu.cancelQueue();" style="display:none;margin-left: 2px; font-size: 8pt; height: 29px;" />
			     <!-- 图片上传 -->
        		
    		 
    		 <strong class="Bstyle AiYa" style="width: 115px;"></strong><a href="javascript:void(0);">
    		 <img id="image_img1" src="${basePath }/images/manager/up.jpg" height="98" width="138"></a>
    		 </div>
          
         
			</div>
			 <span class="tbl_btn" style="margin-left: 300px;"> 
            	 <a href="javascript:void(0);"><span id="save" style="background: #0075c5;">保存</span></a>
             </span>

          
        </div>
</div> 
<script type="text/javascript" src="${basePath}js/swfupload/swfupload.js"></script>
<script type="text/javascript" src="${basePath}js/swfupload/swfupload.queue.js"></script>
<script type="text/javascript" src="${basePath}js/swfupload/fileprogress.js"></script>
<script type="text/javascript" src="${basePath}js/swfupload/handlers.js"></script>
<script type="text/javascript" src="${basePath}js/swfupload/MySwfUpLoad.js"></script>
<script>
MySwfUpLoad("spanButtonPlaceHolder","btnCancel","image_img1","image1");
$(function(){
	
	$("#save").click(function(){
		
		var brandName = $("input[name=brandName]").val(); 
		var brandLogo = $("input[name=brandLogo]").val();  
		
		if(brandName==''){
			alert("品牌名称不能为空");
			return;
		}
		if(brandLogo==''){
			alert("品牌LOGO不能为空");
			return;
		}
		
		$.ajax({ 
			url : "${basePath}manager/Brand_createBrand",
			data : { 
				brandName:brandName,
				brandLogo:brandLogo
			}, 
			dataType :"JSON",
			cache : false, 
			type : "POST",
			success : function(dat){
				if(dat.code==1){
					alert(dat.msg);
					window.location.href="${basePath}manager/Brand_brandInfo?brandId="+dat.data.brandId;
				}else{
					alert(dat.msg);	
				} 
			}
		});
	});

});

</script>
</body>
</html>

